import {createStore} from 'vuex'

const store = createStore ({
    state: {
        user: '',
        login: false,
        router: '',
        // token: localStorage.getItem('token') || '',
    },
    mutations: {
        set (state, name) {
            state.user = name,
            state.login = false

            // console.log(rawData)
            //保持登录状态
            // const {token} = rawData.data
            // state.token = token 
            // localStorage.setItem('userMsg')

        },
        exit(state) {
            state.login = true
        },
        setRouter(state, router) {
            state.router = router
        }
    },
    actions: {

    }
})


export default store